'; echo ""; echo ""; /////////////////////////////Database Error///////////////////////////// if (!$bcon) { echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "\"!\"/
"; echo "Error! Cannot Connect To Database...

"; echo "This error happens usually when backing up the database, please be patient..."; echo "

"; echo ""; echo ""; exit(); } cleardata(); /////////////////////////////Ip Banned///////////////////////////// if(isipbanned($uip,$ubr)) { if(!isshield(getuid_sid($sid))) { echo ""; echo "Ip Block!"; echo ""; echo ""; echo ""; echo "

"; echo "\"x\"/
"; echo "This IP address is blocked!!!
"; echo "
"; echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over

"; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 ")); $remain = $banto[0] - time(); $rmsg = gettimemsg($remain); echo " IP: $rmsg

"; echo "

"; echo "

"; echo "

"; echo "UserID:

"; echo "Password:

"; echo "
"; echo "

Not registered yet?
SignUp
"; echo "Site Rules
"; echo "

"; echo "

"; $onu = getnumonline(); echo "Members Inside: $onu

"; echo "Wap 1.0(wml) Version

"; echo mobads(); echo "
©2006-2007
$sitename
"; echo ""; echo ""; exit(); } } /////////////////////////////Session Expired///////////////////////////// if(($action != "") && ($action!="terms")) { $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) { echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "You are not logged in
"; echo "Or Your session has been expired

"; echo "Login"; echo "

"; echo ""; echo ""; exit(); } } /////////////////////////////Banned///////////////////////////// if(isbanned($uid)) { echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "\"x\"/
"; echo "You are Banned

"; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time Left: $rmsg
"; $nick = getnick_uid($banto[2]); echo "By: $nick
"; echo "Reason: $banto[1]"; //echo "Login"; echo "

"; echo ""; echo ""; exit(); } /////////////////////////////QUIZ///////////////////////////// if($action=="quiz") { addonline(getuid_sid($sid),"Quiz",""); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
"; echo "

Welcome To $sitename Quiz

Play
About
Top Scorers
Top Losers
"; $count_score=mysql_fetch_array(mysql_query("SELECT count(*) from ibwf_users where total_score<'0'")); $count_score1=$count_score[0]; $count_score=mysql_fetch_array(mysql_query("SELECT count(*) from ibwf_users where total_score>'0'")); $count_score2=$count_score[0]; $countup=($count_score1+$count_score2); echo "
$countup people have taken part in Quiz"; if(isowner(getuid_sid($sid))){echo "
Update";} echo "

"; echo "
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////LOSERS///////////////////////////// else if($action=="losers") { addonline(getuid_sid($sid),"Quiz",""); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
"; if($page==""||$page<=0)$page=1; $num_items=mysql_fetch_array(mysql_query("SELECT count(*) from ibwf_users where total_score<'0'")); if(!$num_items[0])$num_items[0]=0; echo "
$num_items[0] have failed miserably
"; echo "

\n"; $items_per_page=10; $num_pages=ceil($num_items[0]/$items_per_page); if($page>$num_pages)$page=$num_pages; $limit_start=($page-1)*$items_per_page; if($num_items[0]==0)$limit_start=0; $sql="SELECT * FROM ibwf_users WHERE total_score<'0' ORDER BY total_score DESC LIMIT $limit_start, $items_per_page"; $items=mysql_query($sql); echo mysql_error(); if($num_items[0]!=0){ while($item=mysql_fetch_array($items)){ echo "".getnick_uid($item["id"])."
".$item["quiz_score"]."
\n"; } } if($page>1){ echo "
<-Prev "; } if($page<$num_pages){ if($page==1)echo "
"; echo "Next->\n"; } echo "
$page/$num_pages

\n"; echo "
<- Back
"; echo "<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////WINNERS///////////////////////////// else if($action=="winners") { addonline(getuid_sid($sid),"Quiz",""); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
"; if($page==""||$page<=0)$page=1; $num_items=mysql_fetch_array(mysql_query("SELECT count(*) from ibwf_users where total_score>'0'")); if(!$num_items[0])$num_items[0]=0; echo "
$num_items[0] players made the leaderboard
"; echo "

\n"; $items_per_page=10; $num_pages=ceil($num_items[0]/$items_per_page); if($page>$num_pages)$page=$num_pages; $limit_start=($page-1)*$items_per_page; if($num_items[0]==0)$limit_start=0; $sql="SELECT * FROM ibwf_users WHERE total_score>'0' ORDER BY total_score DESC LIMIT $limit_start, $items_per_page"; $items=mysql_query($sql); echo mysql_error(); if($num_items[0]!=0){ while($item=mysql_fetch_array($items)){ echo "".getnick_uid($item["id"])."
".$item["quiz_score"]."
\n"; } } if($page>1){ echo "
<-Prev "; } if($page<$num_pages){ if($page==1)echo "
"; echo "Next->\n"; } echo "
$page/$num_pages

\n"; echo "
<- Back
"; echo "<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////ABOUT///////////////////////////// else if($action=="about") { addonline(getuid_sid($sid),"Quiz",""); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
"; echo "

Welcome To $sitename Quiz

this is a multiple choice quiz, each question has 4 possible answers.

for each question you get right, you get points, the points you get depend on the difficulty level you've selected:
easy = 10 points
medium = 20 points
hard = 30 points
but, each time you get a question wrong, you lose the 10, 20 or 30 points depending on the difficulty level you selected, and don't think it stops at zero, oh no, if you get your very first question wrong, you'll need to get the next one right to return to zero.

"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////PLAY///////////////////////////// else if($action=="play") { addonline(getuid_sid($sid),"Quiz",""); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
please select level of difficulty
"; echo "

\n"; $row_profiles=mysql_fetch_array(mysql_query("select * from ibwf_users where id='".getuid_sid($sid)."'")); $row_quiz=mysql_fetch_array(mysql_query("select * from ibwf_quiz")); $score=explode("/",$row_profiles["quiz_score"]); $score=$score[0]+$score[1]+$score[2]; $quiz_easy=$row_profiles["quiz_easy"]; $quiz_medium=$row_profiles["quiz_medium"]; $quiz_hard=$row_profiles["quiz_hard"]; if($row_quiz["switch"]==on||(isowner(getuid_sid($sid))&&$preview==yes)){ if($quiz_easy=="no")echo "easy
\n"; else if($quiz_easy=="yes")echo "** completed **
\n"; if($quiz_medium=="no")echo "medium
\n"; elseif($quiz_medium=="yes")echo "** completed **
\n"; if($quiz_hard=="no")echo "hard
\n"; else if($quiz_hard=="yes")echo "** completed **
\n"; if(($quiz_hard=="yes")&&($quiz_easy=="yes")&&($quiz_medium=="yes")){ echo "you have answered all the questions for this week, please try again next week!
\n"; } echo "
your current score is $score\n"; }else{ echo "Quiz Is Currently Turned Off Please Come Back Later\n"; } echo "

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////QUESTIONS///////////////////////////// else if($action=="questions") { addonline(getuid_sid($sid),"Quiz",""); $row_quizusers=mysql_fetch_array(mysql_query("select * from ibwf_quizusers where uid='".getuid_sid($sid)."'")); if($row_quizusers[$dif."_question"]!=0){$q=$row_quizusers[$dif."_next"];} $row_quiz=mysql_fetch_array(mysql_query("SELECT * FROM ibwf_quiz WHERE difficulty='".$dif."' AND number='".$q."'")); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Quiz
Question $q
"; if($start=yes){ mysql_query("insert into ibwf_quizusers set easy_question='".$q."', easy_next='".$q."', med_question='".$q."', med_next='".$q."', hard_question='".$q."', hard_next='".$q."', uid='".getuid_sid($sid)."'"); } $question = $row_quiz["question"]; $a = $row_quiz["answer1"]; $b = $row_quiz["answer2"]; $c = $row_quiz["answer3"]; $d = $row_quiz["answer4"]; $q = $row_quiz["number"]; $quid = $row_quiz["id"]; $l = $row_quiz["difficulty"]; echo "

$question

$a
$b
$c
$d"; echo "

"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////ANSWER///////////////////////////// else if($action=="answer") { addonline(getuid_sid($sid),"Quiz",""); $row_profiles=mysql_fetch_array(mysql_query("select * from ibwf_users where id='".getuid_sid($sid)."'")); $tmax=$row_ses["tmax"]; $totalscore=explode("/",$row_profiles["quiz_score"]); $row_quiz=mysql_fetch_array(mysql_query("select * from ibwf_quiz where id='$quid'")); $row_quizusers=mysql_fetch_array(mysql_query("select * from ibwf_quizusers where uid='".getuid_sid($sid)."'")); $correct = $row_quiz["answer"]; $ga = $row_quiz["answer1"]; $gb = $row_quiz["answer2"]; $gc = $row_quiz["answer3"]; $gd = $row_quiz["answer4"]; if($a=="a")$guess="$ga"; else if($a=="b")$guess="$gb"; else if($a=="c")$guess="$gc"; else if($a=="d")$guess="$gd"; if($row_quizusers[$l."_next"]!=$q){ echo " ".getnick_sid($sid)."@Quiz
Cheater!

\"[x]\"/
Error!!!
You cannot reload this page to gain more points DO NOT CHEAT!

\n"; echo "
<- Back
<- \"\"/Main Menu
\n"; exit; } else if($guess=="$correct"){ mysql_query("update ibwf_quizusers set ".$l."_question='".$q."', ".$l."_next='".($q+1)."' where uid='".getuid_sid($sid)."'"); if($l=="easy")$plus="10"; else if($l=="med")$plus="20"; else if($l=="hard")$plus="30"; if($l==easy)$totalscore=($totalscore[0]+$plus)."/".$totalscore[1]."/".$totalscore[2]; else if($l==med)$totalscore=$totalscore[0]."/".($totalscore[1]+$plus)."/".$totalscore[2]; else if($l==hard)$totalscore=$totalscore[0]."/".$totalscore[1]."/".($totalscore[2]+$plus); $total_score=explode("/",$totalscore); mysql_query("update ibwf_users set quiz_score='".$totalscore."', total_score='".($total_score[0]+$total_score[1]+$total_score[2])."' where id='".getuid_sid($sid)."'"); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Correct!
"; echo "

you got the right answer, $plus points were added to your score.
"; if($q<10){ $next=$q+1; echo "
go to question $next
"; } else if($q==10){ if($l=="easy"){ mysql_query("update ibwf_users set quiz_easy='yes' where id='".getuid_sid($sid)."'"); } else if($l=="med"){ mysql_query("update ibwf_users set quiz_medium='yes' where id='".getuid_sid($sid)."'"); } else if($l=="hard"){ mysql_query("update ibwf_users set quiz_hard='yes' where id='".getuid_sid($sid)."'"); } echo "
you've completed this round.
select difficulty
"; } echo "

"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } else { if($l=="easy")$plus="10"; else if($l=="med")$plus="20"; else if($l=="hard")$plus="30"; if($l==easy)$totalscore=($totalscore[0]-$plus)."/".$totalscore[1]."/".$totalscore[2]; else if($l==med)$totalscore=$totalscore[0]."/".($totalscore[1]-$plus)."/".$totalscore[2]; else if($l==hard)$totalscore=$totalscore[0]."/".$totalscore[1]."/".($totalscore[2]-$plus); $total_score=explode("/",$totalscore); mysql_query("update ibwf_users set quiz_score='".$totalscore."', total_score='".($total_score[0]+$total_score[1]+$total_score[2])."' where id='".getuid_sid($sid)."'"); echo ""; echo "".getnick_sid($sid)."@Quiz"; echo ""; echo ""; echo ""; echo "
Wrong!
"; echo "

your answer was wrong, $plus points were deducted from your score.

-> try question $q again

"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } } /////////////////////////////OPTIONS///////////////////////////// else if($action=="options") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); $row_quiz=mysql_fetch_array(mysql_query("select * from ibwf_quiz")); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; echo "

Please select the set of questions you wish to edit
easy
medium
hard

preview
lastly, you'll want to make sure ALL users can play,
when a user completes a section, it appears as *complete*, you need to click below, after each update, before turning the quiz back on.


Reset Scores
\n"; if($row_quiz["switch"]=="on"){ echo "
Quiz is active
turn it off?
\n"; }else{ echo "
Quiz is not active
turn it on?
\n"; } echo "

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////RESET///////////////////////////// else if($action=="reset") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; $query="UPDATE ibwf_users SET quiz_easy='no'"; mysql_query($query); $query="UPDATE ibwf_users SET quiz_medium='no'"; mysql_query($query); $query="UPDATE ibwf_users SET quiz_hard='no'"; mysql_query($query); $query="UPDATE ibwf_users SET quiz_score='0/0/0', total_score='0'"; mysql_query($query); $query="delete from ibwf_quizusers where uid!=0"; mysql_query($query); echo "

done!

all sections will now appear as unplayed for all users.

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////QUIZ ON///////////////////////////// else if($action=="on") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; $query="UPDATE ibwf_quiz SET switch='on'"; mysql_query($query); echo "

done!

the quiz was activated, now all other users can participate.

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////QUIZ OFF///////////////////////////// else if($action=="off") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; $query="UPDATE ibwf_quiz SET switch='off'"; mysql_query($query); echo "

done!

the quiz was deactivated, the link has disappeared from the main menu.

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////EDIT///////////////////////////// else if($action=="edit") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; echo "

\n"; $query="select * FROM ibwf_quiz WHERE difficulty='$diff' AND number='$q'"; $result=mysql_query($query); $num_rows=mysql_num_rows($result); $row=mysql_fetch_array($result); $question=$row["question"]; $correct=$row["answer"]; $a=$row["answer1"]; $b=$row["answer2"]; $c=$row["answer3"]; $d=$row["answer4"]; $id=$row["id"]; echo "edit question $q
[difficulty: $diff]


question:

correct answer:


one of the answers below must be the same case and spelling as the correct answer
answer 1:

answer 2:

answer 3:

answer 4:

\n"; echo "
<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////SAVE///////////////////////////// else if($action=="save") { if(!isowner(getuid_sid($sid))) { addonline(getuid_sid($sid),"In The Forbidden Zone",""); echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "Permission Denied!
"; echo "
You cannot use this page...
"; echo "Home"; echo "

"; echo ""; echo ""; exit; } addonline(getuid_sid($sid),"Quiz Options",""); echo ""; echo "".getnick_sid($sid)."@Quiz Options"; echo ""; echo ""; echo ""; echo "
Quiz Options
"; echo "

\n"; $query="UPDATE ibwf_quiz SET question='$nquestion' where number=$q AND difficulty='$diff'"; mysql_query($query); $query="UPDATE ibwf_quiz SET answer='$nright' where number=$q AND difficulty='$diff'"; mysql_query($query); $query="UPDATE ibwf_quiz SET answer1='$na' where number=$q AND difficulty='$diff'"; mysql_query($query); $query="UPDATE ibwf_quiz SET answer2='$nb' where number=$q AND difficulty='$diff'"; mysql_query($query); $query="UPDATE ibwf_quiz SET answer3='$nc' where number=$q AND difficulty='$diff'"; mysql_query($query); $query="UPDATE ibwf_quiz SET answer4='$nd' where number=$q AND difficulty='$diff'"; mysql_query($query); $next=($q+1); if($next<=10){ echo "done!

question $q was updated
question:
$nquestion
right answer:
$nright

answer 1:
$na
answer 2:
$nb
answer 3:
$nc
answer 4:
$nd

Question $next\n"; }else{ echo "done!

that was the last $diff question, taking you back to quiz admin..

question:
$nquestion
right answer:
$nright

answer 1:
$na
answer 2:
$nb
answer 3:
$nc
answer 4:
$nd\n"; } echo "

<- Back
<- \"\"/Main Menu
"; echo ""; echo ""; } /////////////////////////////Error///////////////////////////// else { echo ""; echo "Error!!!"; echo ""; echo ""; echo ""; echo "

"; echo "You are not logged in
"; echo "Or Your session has been expired

"; echo "Login"; echo "

"; echo ""; echo ""; } ?>